package com.wcy.entity.pageVo;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class ApiDescriptor{
    private String add;
    private String update;
    private String delete;
    private String listUrl;//用于选中导出，需要指向支持处理X-Query-Data请求头的list()方法
    private String batchDeleteUrl;//用于批量删除,需要指向一个deleteBatch(List<Integer> ids)的方法
    public ApiDescriptor(String add, String update, String delete) {
        this.add = add;
        this.update = update;
        this.delete = delete;
        this.listUrl = "";
        this.batchDeleteUrl = "";
    }

    public ApiDescriptor(String add, String update, String delete, String batchDeleteUrl) {
        this.add = add;
        this.update = update;
        this.delete = delete;
        this.batchDeleteUrl = batchDeleteUrl;
    }

    public ApiDescriptor(String add, String update, String delete, String batchDeleteUrl,String listUrl) {
        this.add = add;
        this.update = update;
        this.delete = delete;
        this.batchDeleteUrl = batchDeleteUrl;
        this.listUrl = listUrl;
    }

    public static ApiDescriptor empty() {
        return new ApiDescriptor("","","","","");
    }
}
